package cool.tianyou.blue.bird.common.rest;

import cool.tianyou.blue.bird.common.exception.RestApiException;
import cool.tianyou.blue.bird.common.model.entity.RestApiResult;
import cool.tianyou.blue.bird.common.model.entity.ScanResult;
import cool.tianyou.blue.bird.common.model.po.ExtractRule;
import cool.tianyou.blue.bird.common.model.vo.UserVO;
import cool.tianyou.blue.bird.common.service.ExtractRuleService;
import cool.tianyou.blue.bird.common.util.RestResultUtil;
import cool.tianyou.blue.bird.module.auth.model.dto.LoginDTO;
import cool.tianyou.blue.bird.module.auth.service.UserService;
import java.util.List;
import java.util.Map;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author likeguo
 */
@CrossOrigin
@RestController
@RequiredArgsConstructor
@RequestMapping("/config")
public class ConfigController {

  private final ExtractRuleService extractRuleService;

  @PostMapping("/extract/rules")
  public ResponseEntity<RestApiResult<List<ExtractRule>>> extractRules() {
    return RestResultUtil.ok(extractRuleService.rules());
  }



}
